import Vue from 'vue'
import VueI18n from 'vue-i18n'
import elementZH from 'element-ui/lib/locale/lang/zh-CN'
import elementEN from 'element-ui/lib/locale/lang/en'
import customEN from './en'
import customZH from './zh'
import Cookie from 'js-cookie'
Vue.use(VueI18n)
export default new VueI18n({
  // 这个创建实例时的配置对象里面
  // 放两个属性, 1.当前语言设定 2.字典
  locale: Cookie.get('language') || 'zh',
  messages: {
    zh: { hello: '祝你开心每一天！',
      morning: '早安',
      ...elementZH,
      ...customZH
    },
    en: { hello: 'have a good day',
      morning: 'Good morning',
      ...elementEN,
      ...customEN
    }
  }
})
